<template>
  <view class="order-item" @click="handleCheckedChange">
    <view class="left">
      <view class="name-status">
        <text class="order-name">
          {{ orderItem.houseType }}
        </text>
        <text class="order-state">
          {{ type[orderItem.payStatus] }}
        </text>
      </view>
      <view class="order-info">
        <view class="order-info-price">
          <text>订单金额:</text>
          <text>
            {{ orderItem.cashPledge }}
          </text>
        </view>

        <view class="order-info-time">
          <text>订单时间:</text>
          <text>
            {{ orderItem.createTime }}
          </text>
        </view>
      </view>
    </view>
  </view>
</template>
<script setup>
import { defineProps, ref, defineEmits } from "vue";
const props = defineProps({
  orderItem: {
    type: Object,
    default: () => {
      return {
        tagText: "",
        tagType: "info",
        orderItemName: "",
        orderItemPrice: "",
        orderItemTime: "",
        showDot: false,
      };
    },
  },
});
const orderCheckedVal = ref([]);
const type = ref({
  0: "待支付",
  1: "已支付",
  2: "对公转账支付审核中",
  3: "对公转账审核不通过",
  4: "支付中",
  5: "支付失败",
});
const emits = defineEmits(["checkedChange"]);
const handleCheckedChange = () => {
  emits("checkedChange", props.orderItem);
};
</script>
<style scoped lang=less>
@import "./style/order-item";
</style>
